package com.sun.commonadapter;

import android.support.v7.app.ActionBarActivity;
import android.os.Bundle;
import android.widget.ListView;

import java.util.ArrayList;
import java.util.List;

public class MainActivity extends ActionBarActivity {
    private ListView lv;
    private List<Been> mDatas;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        ininDatas();
        initView();


    }

    private void ininDatas() {
        mDatas = new ArrayList<Been>();

        Been been = new Been("安卓新技能1","打造安卓万能适配器","2015-2-26","10086");
        mDatas.add(been);

         been = new Been("安卓新技能2","打造安卓万能适配器","2015-2-26","10086");
        mDatas.add(been);

         been = new Been("安卓新技能3","打造安卓万能适配器","2015-2-26","10086");
        mDatas.add(been);

        been = new Been("安卓新技能4","打造安卓万能适配器","2015-2-26","10086");
        mDatas.add(been);

        been = new Been("安卓新技能5","打造安卓万能适配器","2015-2-26","10086");
        mDatas.add(been);

        been = new Been("安卓新技能6","打造安卓万能适配器","2015-2-26","10086");
        mDatas.add(been);

        been = new Been("安卓新技能7","打造安卓万能适配器","2015-2-26","10086");
        mDatas.add(been);

        been = new Been("安卓新技能8","打造安卓万能适配器","2015-2-26","10086");
        mDatas.add(been);

        been = new Been("安卓新技能9","打造安卓万能适配器","2015-2-26","10086");
        mDatas.add(been);

        been = new Been("安卓新技能10","打造安卓万能适配器","2015-2-26","10086");
        mDatas.add(been);

        been = new Been("安卓新技能11","打造安卓万能适配器","2015-2-26","10086");
        mDatas.add(been);

    }

    private void initView() {
        lv = (ListView) findViewById(R.id.listview);
        MyAdapter4 adapter = new MyAdapter4(this,mDatas,R.layout.items);
        lv.setAdapter(adapter);



    }
}
